﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentValidation.Results;

namespace SW.EF.Web.FrameWork.Extension
{
    public static class FluentValidationExtension
    {
        public static string ToMessage(this IList<ValidationFailure> source)
        {
            return source.Count == 0 ? string.Empty : source.Select(x => "<p>" + x.ErrorMessage + "</p>").Aggregate((a, b) => a + b);
        }
    }
}
